Optimal. Leaf size=188 \[ -\frac {4 b \left (a^2-b^2\right ) \csc (c+d x)}{a^5 d}+\frac {\left (2 a^2-3 b^2\right ) \csc ^2(c+d x)}{2 a^4 d}+\frac {2 b \csc ^3(c+d x)}{3 a^3 d}-\frac {\csc ^4(c+d x)}{4 a^2 d}+\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (\sin (c+d x))}{a^6 d}-\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (a+b \sin (c+d x))}{a^6 d}+\frac {\left (a^2-b^2\right )^2}{a^5 d (a+b \sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 188, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2800, 908}
\begin {gather*} \frac {2 b \csc ^3(c+d x)}{3 a^3 d}-\frac {\csc ^4(c+d x)}{4 a^2 d}+\frac {\left (a^2-b^2\right )^2}{a^5 d (a+b \sin (c+d x))}-\frac {4 b \left (a^2-b^2\right ) \csc (c+d x)}{a^5 d}+\frac {\left (2 a^2-3 b^2\right ) \csc ^2(c+d x)}{2 a^4 d}+\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (\sin (c+d x))}{a^6 d}-\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (a+b \sin (c+d x))}{a^6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 2800
Rubi steps
\begin {align*} \int \frac {\cot ^5(c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\frac {\text {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x^5 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {b^4}{a^2 x^5}-\frac {2 b^4}{a^3 x^4}+\frac {-2 a^2 b^2+3 b^4}{a^4 x^3}+\frac {4 b^2 \left (a^2-b^2\right )}{a^5 x^2}+\frac {a^4-6 a^2 b^2+5 b^4}{a^6 x}-\frac {\left (a^2-b^2\right )^2}{a^5 (a+x)^2}+\frac {-a^4+6 a^2 b^2-5 b^4}{a^6 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {4 b \left (a^2-b^2\right ) \csc (c+d x)}{a^5 d}+\frac {\left (2 a^2-3 b^2\right ) \csc ^2(c+d x)}{2 a^4 d}+\frac {2 b \csc ^3(c+d x)}{3 a^3 d}-\frac {\csc ^4(c+d x)}{4 a^2 d}+\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (\sin (c+d x))}{a^6 d}-\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (a+b \sin (c+d x))}{a^6 d}+\frac {\left (a^2-b^2\right )^2}{a^5 d (a+b \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 6.12, size = 187, normalized size = 0.99 \begin {gather*} -\frac {4 (a-b) b (a+b) \csc (c+d x)}{a^5 d}+\frac {\left (2 a^2-3 b^2\right ) \csc ^2(c+d x)}{2 a^4 d}+\frac {2 b \csc ^3(c+d x)}{3 a^3 d}-\frac {\csc ^4(c+d x)}{4 a^2 d}+\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (\sin (c+d x))}{a^6 d}-\frac {\left (a^4-6 a^2 b^2+5 b^4\right ) \log (a+b \sin (c+d x))}{a^6 d}+\frac {\left (a^2-b^2\right )^2}{a^5 d (a+b \sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.43, size = 172, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {-\frac {\left (a^{4}-6 a^{2} b^{2}+5 b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{6}}+\frac {a^{4}-2 a^{2} b^{2}+b^{4}}{a^{5} \left (a +b \sin \left (d x +c \right )\right )}-\frac {1}{4 a^{2} \sin \left (d x +c \right )^{4}}-\frac {-2 a^{2}+3 b^{2}}{2 a^{4} \sin \left (d x +c \right )^{2}}+\frac {\left (a^{4}-6 a^{2} b^{2}+5 b^{4}\right ) \ln \left (\sin \left (d x +c \right )\right )}{a^{6}}+\frac {2 b}{3 a^{3} \sin \left (d x +c \right )^{3}}-\frac {4 b \left (a^{2}-b^{2}\right )}{a^{5} \sin \left (d x +c \right )}}{d}\) | \(172\) |
default | \(\frac {-\frac {\left (a^{4}-6 a^{2} b^{2}+5 b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{6}}+\frac {a^{4}-2 a^{2} b^{2}+b^{4}}{a^{5} \left (a +b \sin \left (d x +c \right )\right )}-\frac {1}{4 a^{2} \sin \left (d x +c \right )^{4}}-\frac {-2 a^{2}+3 b^{2}}{2 a^{4} \sin \left (d x +c \right )^{2}}+\frac {\left (a^{4}-6 a^{2} b^{2}+5 b^{4}\right ) \ln \left (\sin \left (d x +c \right )\right )}{a^{6}}+\frac {2 b}{3 a^{3} \sin \left (d x +c \right )^{3}}-\frac {4 b \left (a^{2}-b^{2}\right )}{a^{5} \sin \left (d x +c \right )}}{d}\) | \(172\) |
risch | \(\frac {2 i \left (-18 \,{\mathrm e}^{i \left (d x +c \right )} b^{2} a^{2}+15 \,{\mathrm e}^{i \left (d x +c \right )} b^{4}+3 \,{\mathrm e}^{i \left (d x +c \right )} a^{4}-18 a^{2} b^{2} {\mathrm e}^{9 i \left (d x +c \right )}+82 a^{2} b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-128 a^{2} b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+82 a^{2} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+15 b^{4} {\mathrm e}^{9 i \left (d x +c \right )}-24 a^{4} {\mathrm e}^{7 i \left (d x +c \right )}-60 b^{4} {\mathrm e}^{7 i \left (d x +c \right )}+30 a^{4} {\mathrm e}^{5 i \left (d x +c \right )}+90 b^{4} {\mathrm e}^{5 i \left (d x +c \right )}-24 a^{4} {\mathrm e}^{3 i \left (d x +c \right )}-60 b^{4} {\mathrm e}^{3 i \left (d x +c \right )}+3 a^{4} {\mathrm e}^{9 i \left (d x +c \right )}+18 i a^{3} b \,{\mathrm e}^{2 i \left (d x +c \right )}+44 i a^{3} b \,{\mathrm e}^{6 i \left (d x +c \right )}+45 i a \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+15 i a \,b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-15 i a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-45 i a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-44 i a^{3} b \,{\mathrm e}^{4 i \left (d x +c \right )}-18 i a^{3} b \,{\mathrm e}^{8 i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right ) d \,a^{5}}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {6 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{a^{4} d}+\frac {5 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{4}}{a^{6} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{a^{2} d}+\frac {6 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right ) b^{2}}{a^{4} d}-\frac {5 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right ) b^{4}}{a^{6} d}\) | \(587\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 189, normalized size = 1.01 \begin {gather*} \frac {\frac {5 \, a^{3} b \sin \left (d x + c\right ) + 12 \, {\left (a^{4} - 6 \, a^{2} b^{2} + 5 \, b^{4}\right )} \sin \left (d x + c\right )^{4} - 3 \, a^{4} - 6 \, {\left (6 \, a^{3} b - 5 \, a b^{3}\right )} \sin \left (d x + c\right )^{3} + 2 \, {\left (6 \, a^{4} - 5 \, a^{2} b^{2}\right )} \sin \left (d x + c\right )^{2}}{a^{5} b \sin \left (d x + c\right )^{5} + a^{6} \sin \left (d x + c\right )^{4}} - \frac {12 \, {\left (a^{4} - 6 \, a^{2} b^{2} + 5 \, b^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{6}} + \frac {12 \, {\left (a^{4} - 6 \, a^{2} b^{2} + 5 \, b^{4}\right )} \log \left (\sin \left (d x + c\right )\right )}{a^{6}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 542 vs.
\(2 (182) = 364\).
time = 0.39, size = 542, normalized size = 2.88 \begin {gather*} \frac {21 \, a^{5} - 82 \, a^{3} b^{2} + 60 \, a b^{4} + 12 \, {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (18 \, a^{5} - 77 \, a^{3} b^{2} + 60 \, a b^{4}\right )} \cos \left (d x + c\right )^{2} - 12 \, {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4} + {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5} + {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) + 12 \, {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4} + {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{5} - 6 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5} + {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \sin \left (d x + c\right )\right ) - {\left (31 \, a^{4} b - 30 \, a^{2} b^{3} - 6 \, {\left (6 \, a^{4} b - 5 \, a^{2} b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{12 \, {\left (a^{7} d \cos \left (d x + c\right )^{4} - 2 \, a^{7} d \cos \left (d x + c\right )^{2} + a^{7} d + {\left (a^{6} b d \cos \left (d x + c\right )^{4} - 2 \, a^{6} b d \cos \left (d x + c\right )^{2} + a^{6} b d\right )} \sin \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{5}{\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 6.49, size = 278, normalized size = 1.48 \begin {gather*} \frac {\frac {12 \, {\left (a^{4} - 6 \, a^{2} b^{2} + 5 \, b^{4}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{6}} - \frac {12 \, {\left (a^{4} b - 6 \, a^{2} b^{3} + 5 \, b^{5}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{6} b} + \frac {12 \, {\left (a^{4} b \sin \left (d x + c\right ) - 6 \, a^{2} b^{3} \sin \left (d x + c\right ) + 5 \, b^{5} \sin \left (d x + c\right ) + 2 \, a^{5} - 8 \, a^{3} b^{2} + 6 \, a b^{4}\right )}}{{\left (b \sin \left (d x + c\right ) + a\right )} a^{6}} - \frac {25 \, a^{4} \sin \left (d x + c\right )^{4} - 150 \, a^{2} b^{2} \sin \left (d x + c\right )^{4} + 125 \, b^{4} \sin \left (d x + c\right )^{4} + 48 \, a^{3} b \sin \left (d x + c\right )^{3} - 48 \, a b^{3} \sin \left (d x + c\right )^{3} - 12 \, a^{4} \sin \left (d x + c\right )^{2} + 18 \, a^{2} b^{2} \sin \left (d x + c\right )^{2} - 8 \, a^{3} b \sin \left (d x + c\right ) + 3 \, a^{4}}{a^{6} \sin \left (d x + c\right )^{4}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.90, size = 439, normalized size = 2.34 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (3\,a^4-62\,a^2\,b^2+64\,b^4\right )-\frac {a^4}{4}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {11\,a^4}{4}-\frac {10\,a^2\,b^2}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (20\,a\,b^3-\frac {62\,a^3\,b}{3}\right )-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (60\,a^4\,b-96\,a^2\,b^3+32\,b^5\right )}{a}+\frac {5\,a^3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{6}}{d\,\left (16\,a^6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,a^6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+32\,b\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,a^2\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {\frac {a^2}{16}+\frac {b^2}{8}}{a^4}+\frac {1}{8\,a^2}-\frac {b^2}{2\,a^4}\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {b\,\left (32\,a^2+64\,b^2\right )}{64\,a^5}-\frac {b}{4\,a^3}+\frac {4\,b\,\left (\frac {\frac {a^2}{8}+\frac {b^2}{4}}{a^4}+\frac {1}{4\,a^2}-\frac {b^2}{a^4}\right )}{a}\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^4-6\,a^2\,b^2+5\,b^4\right )}{a^6\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,a^3\,d}-\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (a^4-6\,a^2\,b^2+5\,b^4\right )}{a^6\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________